package segundoapartado;

import java.awt.Graphics;
import java.awt.Image;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class ImageShow extends JPanel {
	 
    private String path;
    private Image img;
    public int width, height;
 
    public ImageShow(String path) throws IOException {
 
        this.path = path;
        img = ImageIO.read(new File(path));
 
        width = img.getWidth(this);
        height = img.getHeight(this) + 38;
    }
 
    @Override
    public void paint(Graphics g) {
        if (img != null) {
            g.drawImage(img, 0, 0, this);
        }
    }
}